#! /usr/bin/env bash
#
# Given a dump of the state database that has been converted to "key = value"
# format, this script replaces values that change between test runs with
# the string XXXXX.

# Replace zeek version, zeek PID, and zeekctl cfg hash (zeekctl cfg has absolute
# paths that change for each test run, so the config hash changes for each
# test run).
sed -e 's/^zeekversion = "[0-9.a-z-]*"/zeekversion = "XXXXX"/' -e 's/^configchksum = "[0-9a-f]*"/configchksum = "XXXXX"/' -e 's/^hash-zeekctlcfg = "[0-9a-f]*"/hash-zeekctlcfg = "XXXXX"/' -e 's/^\([a-z0-9-]*-pid\) = [0-9][0-9]*/\1 = XXXXX/' -e 's/^global-hash-seed = "[0-9a-f]*"/global-hash-seed = "XXXXXXXX"/'

